package com.myjar.excel.serializer;

import org.apache.poi.ss.usermodel.Cell;

public class IntegerCodec implements ObjectSerializer<Integer> {

    static final IntegerCodec instance = new IntegerCodec();

    @Override
    public void write(Cell cell, Integer integer) {
        cell.setCellValue(integer);
    }

    @Override
    public Integer read(Cell cell) {
        return Integer.parseInt(cell.getNumericCellValue() + "");
    }

}
